<template>
  <a-form-item label="车次编号" class="trainCodeItem">
    <a-input
      v-decorator="[
        'code',
        {
          rules: [{ required: true, message: '请输入车次编号!' }],
        },
      ]"
      placeholder="请输入车次编号"
      @change="changeTrainCode"
      :value="value"
      class="trainCodeInput"
      :allowClear="true"
    />
  </a-form-item>
</template>

<script>
export default {
  name: "",
  props: {
    value: {
      type: String,
      default: "",
    },
  },
  methods: {
    changeTrainCode(e) {
      this.$emit("input", e.target.value);
    },
  },
};
</script>

<style lang="less" scoped>
.trainCodeItem {
  display: flex;
  margin-bottom: 0;
  .trainCodeInput {
    width: 195px !important;
  }
}
</style>
